module.exports = `
<template>
<div class="login">
  <div class="login-box">
    <div class="header">
      <div class="title">
        <span class="text">{{{resetPwdTitle}}}</span>
        <span class="triangle"></span>
      </div>
    </div>
    <div class="content">
      <!-- 
      <input
        id="verifycode"
        class="input"
        v-model="oldPwd"
        type="text"
        placeholder="输入旧密码"
        autocomplete="off"
      />
      -->
      <input
        id="password"
        class="input"
        v-model="newPwd"
        :type="isSetPwd ? 'password': 'text'"
        placeholder="请输新入密码"
        autocomplete="off"
      />

      <input
        id="comfirmPwd"
        class="input"
        v-model="comfirmNewPwd"
        :type="isSetPwd ? 'password': 'text'"
        placeholder="确认密码"
        autocomplete="off"
      />
    </div>
    <div class="option">
      <div class="login-submit-btn" @click="handleModify">确认修改</div>
    </div>
  </div>
</div>
</template>

<script>
import jhTools from "@/utils/jhTools"; //工具函数
import API from "@/utils/api_config.js"; //引入api
export default {
name: "resetPwd",
data() {
  return {
    oldPwd: "",
    newPwd: "",
    comfirmNewPwd: "",

    allowGetCode: true, //允许获取验证码
    isSetPwd: false, //是否设置密码格式
  };
},

mounted() {
  setTimeout(() => {
    this.isSetPwd = true;
  }, 1000);
},
methods: {
  //修改密码
  handleModify() {
    let url = {{{resetApi}}} + '?pwd=' + this.newPwd;
    var data = jhTools.checkInputTool({
      tThis: this,
      dataArr: ["newPwd", "comfirmNewPwd"],
      tipsObj: {
        newPwd: "新密码",
        comfirmNewPwd: "确认新密码",
      },
    });
    if (!data) return;
    if (this.newPwd != this.comfirmNewPwd) {
      this.$alert("确认密码与新密码必须一致", "提示", {
        confirmButtonText: "确定",
        callback: (action) => {},
      });
      return;
    }

    var params = {
      // newPassword: this.newPwd,
      // oldPassword: this.oldPwd,
      pwd: this.newPwd
    };
    console.log("参数", params);
    jhTools.post(
      url,
      params,
      null,
      (res) => {
        console.log("结果", res);
        if (res.code == 200) {
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          sessionStorage.removeItem("sessionId");
          sessionStorage.removeItem("userId");
          sessionStorage.removeItem("manager");
          setTimeout(() => {
            this.$router.push({
              path: "/admin_login",
            });
            this.$router.go(0);
          }, 1000);
        } else {
          this.$alert(res.message, "提示", {
            confirmButtonText: "确定",
            callback: (action) => {},
          });
        }
      },
      (err) => {
        console.log(err);
      }
    );
  },
},
};
</script>

<style lang="scss" scoped>
// @import '~styles/mixins.scss';
// @import '~styles/variables.scss';

.login {
width: 100%;
height: 100%;
background-color: #fff;
display: flex;
justify-content: center;
align-items: center;
}

.login-box {
width: 421px;
min-height: 300px;
line-height: 20px;
border-radius: 4px;
text-align: center;
border: 1px solid rgba(219, 215, 219, 1);
padding-bottom: 90px;

.header {
  position: relative;
  height: 144px;
  border-width: 0;

  .title {
    position: absolute;
    left: -20px;
    top: 50px;
    width: 409px;
    height: 60px;
    line-height: 20px;
    border-radius: 1px;
    background-color: #4e6ef2;
    text-align: center;

    .text {
      position: absolute;
      top: 17px;
      left: 60px;
      min-width: 60px;
      height: 30px;
      line-height: 30px;
      color: rgba(255, 255, 255, 1);
      font-size: 18px;
      text-align: center;
      font-family: Roboto;
    }

    .triangle {
      position: absolute;
      bottom: -20px;
      left: -1px;
      width: 0;
      height: 0;
      border: 10px solid transparent;
      border-top-color: rgba(106, 122, 153, 1);
      border-right-color: rgba(106, 122, 153, 1);
    }
  }
}

.content {
  .input {
    padding-left: 20px;
    width: 343px;
    height: 53px;
    border-radius: 4px;
    color: rgba(136, 136, 136, 1);
    font-size: 14px;
    text-align: left;
    font-family: Roboto;
    border: 1px solid rgba(222, 222, 222, 1);
    box-sizing: border-box;
    margin-top: 20px;
    outline-color: #ccc;
  }

  .first {
    margin-top: 0;
  }

  .mobile-box {
    position: relative;
    .get-verify-code {
      position: absolute;
      top: 8px;
      right: 50px;
      cursor: pointer;
      border: 1px solid #ddd;
      font-size: 14px;
      border-radius: 6px;
      padding: 8px;
      color: #888888;
    }
    .get-verify-code:hover {
      opacity: 0.8;
    }
  }
}

.option {
  position: relative;
  height: 60px;

  .register-btn {
    position: absolute;
    top: 21px;
    left: 50px;
    width: 100%;

    color: rgba(9, 126, 242, 1);
    font-size: 14px;
    font-family: SourceHanSansSC-regular;
    width: 30px;
    height: 26px;
  }

  .login-submit-btn {
    position: absolute;
    top: 52px;
    left: 38px;
    width: 344px;
    height: 55px;
    line-height: 55px;
    border-radius: 4px;
    background-color: #4e6ef2;
    color: rgba(255, 255, 255, 1);
    font-size: 18px;
    text-align: center;
    font-family: Roboto;
    border: 1px solid rgba(222, 222, 222, 1);
    cursor: pointer;
    opacity: 0.9;
  }

  .login-submit-btn:hover {
    opacity: 1;
  }
}
}
</style>
`